<%@ page import="myschool.service.StudentService" %>
<%@ page import="myschool.entity.Student" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %><%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/7/3
  Time: 15:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    String sname = request.getParameter("sname");
    String sex = request.getParameter("sex");
    String telephone = request.getParameter("telephone");
    String qq = request.getParameter("qq");
    String wechat = request.getParameter("wechat");
    int gid = Integer.parseInt(request.getParameter("gid"));
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    Date enterdate = format.parse(request.getParameter("enterdate"));
    String city = request.getParameter("city");
    Date birthday = format.parse(request.getParameter("birthday"));
    String address = request.getParameter("address");
    String pass = request.getParameter("pass");
    String idcardpic = request.getParameter("idcardpic");
   // Student stu= new Student(sname, sex, telephone, qq, wechat, gid, enterdate, city, birthday, address, pass, idcardpic);
    Student stu= new Student(sname, sex, telephone, qq, wechat, gid, null, city, null, address, pass, idcardpic);
    int add = StudentService.ME.add(stu);
    if (add > 0) {%>
<h2>
    新增成功
</h2>
<%} else {%>
<h2>
    新增失败
</h2>
<%}%>
</body>
</html>
